package com.ch_linghu.fanfoudroid.data;

import android.os.Parcel;
import android.os.Parcelable;
import android.widget.AnalogClock;

public class Bus implements Parcelable {
	
	public String bid;
	public String name;
	public String city;
	public String location;
	public String path;
	public String intro;
	public String announce;
	public int memberCount;
	
	public Bus(){
		
	}
	
	public static Bus  create(com.ch_linghu.fanfoudroid.fanfou.Bus b){
		Bus bus =new Bus();
		bus.bid=b.getBid();
		bus.name=b.getName();
		bus.city=b.getCity();
		bus.location=b.getLocation();
		bus.path=b.getPath();
		bus.intro=b.getIntro();
		bus.announce=b.getAnnounce();
		bus.memberCount=b.getMemberCount();
		
		return bus;
		
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeString(bid);
		out.writeString(name);
		out.writeString(city);
		out.writeString(location);
		out.writeString(path);
		out.writeString(intro);
		out.writeString(announce);
		out.writeInt(memberCount);

	}
	
	public static final Parcelable.Creator<Bus> CREATOR = new Parcelable.Creator<Bus>() {
		public Bus createFromParcel(Parcel in) {
			return new Bus(in);
		}

		public Bus[] newArray(int size) {
			// return new User[size];
			throw new UnsupportedOperationException();
		}
	};
	
	public Bus(Parcel in){
		bid = in.readString();
		name = in.readString();
		city = in.readString();
		location =in.readString();
		path = in.readString();
		intro =in.readString();
		announce =in.readString();
		memberCount =in.readInt();
		
	}

}
